This function uses the specified date to calculate the calendar week and the number of days that have passed since the beginning of the year for the USA and many other countries.
LGF_GetCalendarWeek_US (FC) | ||||||||
---|---|---|---|---|---|---|---|---|
DTL | date | Ret_Val | DInt | |||||
calendarDay | DInt | |||||||
error | Bool | |||||||
status | Word | |||||||
Identifier | Data type | Description |
---|---|---|
date | DTL | Date used to calculate the calendar week and days since 1 January |
Identifier | Data type | Description |
---|---|---|
Ret_Val | DInt | Number of the calendar week. |
calendarDay | DInt | Days past since January 1st on given date |
error | Bool | FALSE: No error / TRUE: An error occurred during the execution of the FB |
status | Word | 16#0000-16#7FFF: Status of the FB / 16#8000-16#FFFF: Error identification (see following Table) |
Code / Value | Identifier / Description |
---|---|
16#0000 | STATUS_NO_ERROR Status: no error occurred |
16#8201 | ERR_LIM_DATE Date out of the range, has to be greater than <1970-01-01 ; 2262-04-11> |
Counting method for the USA and many other countries
Version & Date | Change description | |
---|---|---|
01.00.00 | Simatic Systems Support | |
13.11.2019 | First release based on spli from LGF_CalenderWeek (previously LGF_CalenderWeek_ISO) | |
03.00.00 | Simatic Systems Support | |
23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library | |
03.00.01 | Simatic Systems Support | |
19.01.2020 | Insert documentation |